#include "threadpool.hpp"
#include "Task.hpp"
#include <memory>

using namespace ThreadPoolModule;

int main()
{
    ENABLE_CONSOLE_LOG();
    // ENABLE_FILE_LOG();

    std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>(20);
    tp->Start();
    sleep(1);

    int cnt = 10;
    char c;
    while (cnt)
    {
        // std::cin >> c;
        task_t t = Push;
        tp->Enqueue(t);
        // tp->Enqueue(Push);
        cnt--;
        sleep(1);
    }
    
    tp->Stop();

    sleep(3);

    tp->Wait();

    return 0;
}